package com.qys.livesMall.shop.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.qys.livesMall.common.result.R;
import com.qys.livesMall.shop.modal.entity.ShopOrder;
import com.qys.livesMall.shop.modal.entity.ShopOrderIdea;
import com.qys.livesMall.shop.modal.entity.ShopOrderInfo;
import com.qys.livesMall.shop.modal.entity.ShopOrderSku;

import java.time.LocalDateTime;
import java.util.List;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author gmx
 * @since 2023-06-19
 */
public interface ShopOrderInfoService extends IService<ShopOrderInfo> {
    /**
     * 下单
     * @param order
     * @param orderSkus
     * @param source 下单来源 1：购物车，2：直接下单，3：秒杀，：4：直播间
     * @return
     */
    R<ShopOrder> add(ShopOrderInfo order, List<ShopOrderSku> orderSkus, Integer source);


    R pay(Long orderId);

    R cancel(ShopOrderIdea idea);


    R delete(ShopOrderIdea idea);

    R operation(Long id);

    Integer getOrderNum(Long shopId, LocalDateTime startTime,LocalDateTime endTime);

    Integer getGoodsNum(Long shopId, LocalDateTime startTime, LocalDateTime endTime);

    Long getWaitShipNum(Long shopId);

    Long getWaitReturnNum(Long shopId);

    void shipped(Long orderSkuId);

    List<ShopOrderInfo> getOutTimeShipped(long start,long end);

    List<ShopOrderInfo> getOrderYesterday();
}
